# 运行后创建课程文件重命名后的拷贝文件夹

import os
import shutil

os.makedirs('..\\..\\..\\lessonfilescopy')
# 创建拷贝文件夹

pathlist = [
    'week0-python-installation.pdf', 
    'week1-git.pdf', 
    'week2-control-flow.pdf', 
    'week3-function-class-object.pdf', 
    'week4-list-tuple.pdf', 
    'week5-dictionary-set.pdf', 
    'week6-string-regex.pdf', 
    'week7-python-file.pdf']
# 储存正课文件名(可以用正则表达式匹配, 但是我懒-话说DLC不算罢)

for path in pathlist:
    oldpath = '..\\..\\..\\lessons\\' + path
    Path = path.split('-')
    P = []
    for i in Path:
        P.append(i.capitalize())
    path = ' '.join(P)
    newpath = '..\\..\\..\\lessonfilescopy\\' + path
    shutil.copyfile(oldpath, newpath)
# 复制文件到新文件夹(并重命名)

# os.rename 想用但是没有用上